import {Component, OnInit} from '@angular/core';
import { HttpClient } from '@angular/common/http';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css'],
  // template: '{{name}} <h2> {{address | json}} hello</h2>'
})
export class AppComponent implements OnInit{
  title = 'app works!';
  name: string;
  address: any;
  isShow = true;
  items = ['1', '2', '3'];
  skills = [];

  constructor(private http:HttpClient) {
    this.name = 'Sale';
    this.address = {
      province: '福建',
      city: '厦门'
    };
  }
  ngOnInit(){
    this.http.get('http://192.168.0.129:8080/pmis/test').subscribe(data=>{
      if(data){
        console.log('请求成功'+data)
      }
    })
  }

  add(skill: string) {
    let skillStr = skill.trim();
    if (this.skills.indexOf(skillStr) === -1) {
      this.skills.push(skillStr);
    }
  }

  test(){
    console.log('tets');
  }
}
